// noinspection NpmUsedModulesInstalled,JSUnusedGlobalSymbols

import request from '@/utils/request'

export default {

  // 1 后台获取前台展示的banner
  getIndexBannerList() {
    return request({
      url: '/itservice/banneradmin/getIndexBannerList',
      method: 'get'
    })
  },

  // 2 修改
  updateBanner(banner) {
    return request({
      url: '/itservice/banneradmin/updateBanner',
      method: 'post',
      data: banner
    })
  },

  // 3 添加
  addBanner(banner) {
    return request({
      url: '/itservice/banneradmin/addBanner',
      method: 'post',
      data: banner
    })
  },

  // 4 删除
  removeBanner(id) {
    return request({
      url: `/itservice/banneradmin/removeBannerById/${id}`,
      method: 'delete'
    })
  },

  // 5 分页查看
  getPageBanner(page, limit) {
    return request({
      url: `/itservice/banneradmin/pageBanner/${page}/${limit}`,
      method: 'get'
    })
  },

  //6 根据id查看banner信息
  getBannerInfoById(bannerId) {
    return request({
      url: `/itservice/banneradmin/getBannerById/${bannerId}`,
      method: 'get'
    })
  },

  //7 更改轮播图状态
  changeState(bannerId) {
    return request({
      url: `/itservice/banneradmin/changeState/${bannerId}`,
      method: 'get'
    })
  },

  //8 一键更改轮播图状态
  batchChangeBannerState(state) {
    return request({
      url: `/itservice/banneradmin/batchChangeBannerState/${state}`,
      method: 'get'
    })
  }
}
